/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "gtest/gtest.h"
#include "logger.h"
#include "libabckit/c/ir_core.h"
#include "generated/insn_info.h"

namespace libabckit::test::codegen {
typedef ark::compiler::RuntimeInterface::IntrinsicId IntrinsicId;
class InsnInfoTest : public ::testing::Test {};
using InnerMap = std::unordered_map<size_t, AbckitBitImmSize>;
using ArgsToResultMap = std::unordered_map<IntrinsicId, InnerMap>;
constexpr auto B0 = AbckitBitImmSize::BITSIZE_0;
constexpr auto B4 = AbckitBitImmSize::BITSIZE_4;
constexpr auto B8 = AbckitBitImmSize::BITSIZE_8;
constexpr auto B16 = AbckitBitImmSize::BITSIZE_16;
constexpr auto B32 = AbckitBitImmSize::BITSIZE_32;
constexpr size_t INDEX_2 = 2;
constexpr size_t INDEX_3 = 3;

ArgsToResultMap gArgsToResultMap_ = {
    {IntrinsicId::DYN_CREATEEMPTYARRAY_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CREATEARRAYWITHBUFFER_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CREATEOBJECTWITHBUFFER_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_NEWOBJRANGE_IMM8_IMM8_V8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_NEWLEXENV_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_ADD2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_SUB2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_MUL2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_DIV2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_MOD2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_EQ_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_NOTEQ_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LESS_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LESSEQ_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_GREATER_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_GREATEREQ_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_SHL2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_SHR2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_ASHR2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_AND2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_OR2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_XOR2_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_EXP_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_TYPEOF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_TONUMBER_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_TONUMERIC_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_NEG_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_NOT_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_INC_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_DEC_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_INSTANCEOF_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STRICTNOTEQ_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STRICTEQ_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLARG0_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLARG1_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLARGS2_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLARGS3_IMM8_V8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLTHIS0_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLTHIS1_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLTHIS2_IMM8_V8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLTHIS3_IMM8_V8_V8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLTHISRANGE_IMM8_IMM8_V8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_SUPERCALLTHISRANGE_IMM8_IMM8_V8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEFINEFUNC_IMM8_ID16_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEFINEMETHOD_IMM8_ID16_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEFINECLASSWITHBUFFER_IMM8_ID16_ID16_IMM16_V8, {{0, B8}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_LDOBJBYVALUE_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STOBJBYVALUE_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDSUPERBYVALUE_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDOBJBYINDEX_IMM8_IMM16, {{0, B8}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_STOBJBYINDEX_IMM8_V8_IMM16, {{0, B8}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_LDLEXVAR_IMM4_IMM4, {{0, B4}, {1, B4}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_STLEXVAR_IMM4_IMM4, {{0, B4}, {1, B4}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_TRYLDGLOBALBYNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_TRYSTGLOBALBYNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDGLOBALVAR_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDOBJBYNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STOBJBYNAME_IMM8_ID16_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDSUPERBYNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STCONSTTOGLOBALRECORD_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STTOGLOBALRECORD_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDTHISBYNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STTHISBYNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDTHISBYVALUE_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STTHISBYVALUE_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_GETITERATOR_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CLOSEITERATOR_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CREATEREGEXPWITHLITERAL_IMM8_ID16_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_CREATEREGEXPWITHLITERAL_IMM16_ID16_IMM8, {{0, B16}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_CALLRANGE_IMM8_IMM8_V8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEFINEFUNC_IMM16_ID16_IMM8, {{0, B16}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEFINECLASSWITHBUFFER_IMM16_ID16_ID16_IMM16_V8, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_GETTEMPLATEOBJECT_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_SETOBJECTWITHPROTO_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYVALUE_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYINDEX_IMM8_V8_IMM16, {{0, B8}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_STOWNBYNAME_IMM8_ID16_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_GETMODULENAMESPACE_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STMODULEVAR_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDLOCALMODULEVAR_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDEXTERNALMODULEVAR_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STGLOBALVAR_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CREATEEMPTYARRAY_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CREATEARRAYWITHBUFFER_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CREATEOBJECTWITHBUFFER_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_NEWOBJRANGE_IMM16_IMM8_V8, {{0, B16}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_TYPEOF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDOBJBYVALUE_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOBJBYVALUE_IMM16_V8_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDSUPERBYVALUE_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDOBJBYINDEX_IMM16_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_STOBJBYINDEX_IMM16_V8_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_LDLEXVAR_IMM8_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_STLEXVAR_IMM8_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_TRYLDGLOBALBYNAME_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_TRYSTGLOBALBYNAME_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYNAMEWITHNAMESET_IMM8_ID16_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDOBJBYNAME_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOBJBYNAME_IMM16_ID16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDSUPERBYNAME_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDTHISBYNAME_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STTHISBYNAME_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_LDTHISBYVALUE_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STTHISBYVALUE_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYVALUEWITHNAMESET_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_GETITERATOR_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CLOSEITERATOR_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CREATEOBJECTWITHEXCLUDEDKEYS_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_NEWOBJAPPLY_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_NEWOBJAPPLY_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_NEWLEXENVWITHNAME_IMM8_ID16, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_SUPERCALLSPREAD_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_APPLY_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_SUPERCALLARROWRANGE_IMM8_IMM8_V8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEFINEMETHOD_IMM16_ID16_IMM8, {{0, B16}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_GETTEMPLATEOBJECT_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_SETOBJECTWITHPROTO_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYVALUE_IMM16_V8_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STSUPERBYVALUE_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STSUPERBYVALUE_IMM16_V8_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYINDEX_IMM16_V8_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_STOWNBYNAME_IMM16_ID16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_COPYRESTARGS_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STSUPERBYNAME_IMM8_ID16_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_STSUPERBYNAME_IMM16_ID16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYVALUEWITHNAMESET_IMM16_V8_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_STOWNBYNAMEWITHNAMESET_IMM16_ID16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_SETGENERATORSTATE_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_GETASYNCITERATOR_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_LDPRIVATEPROPERTY_IMM8_IMM16_IMM16, {{0, B8}, {1, B16}, {INDEX_2, B16}, {INDEX_3, B0}}},
    {IntrinsicId::DYN_STPRIVATEPROPERTY_IMM8_IMM16_IMM16_V8, {{0, B8}, {1, B16}, {INDEX_2, B16}, {INDEX_3, B0}}},
    {IntrinsicId::DYN_TESTIN_IMM8_IMM16_IMM16, {{0, B8}, {1, B16}, {INDEX_2, B16}, {INDEX_3, B0}}},
    {IntrinsicId::DYN_DEFINEFIELDBYNAME_IMM8_ID16_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_DEFINEPROPERTYBYNAME_IMM8_ID16_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_CREATEOBJECTWITHEXCLUDEDKEYS_PREF_IMM16_V8_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_DEFINEFIELDBYVALUE_PREF_IMM8_V8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_NEWOBJRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_DEFINEFIELDBYINDEX_PREF_IMM8_IMM32_V8, {{0, B8}, {1, B32}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_WIDE_NEWLEXENV_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_DEPRECATED_CREATEARRAYWITHBUFFER_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_NEWLEXENVWITHNAME_PREF_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_CREATEPRIVATEPROPERTY_PREF_IMM16_ID16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_DEPRECATED_CREATEOBJECTWITHBUFFER_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_CALLRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_DEFINEPRIVATEPROPERTY_PREF_IMM8_IMM16_IMM16_V8,
     {{0, B8}, {1, B16}, {INDEX_2, B16}, {INDEX_3, B0}}},
    {IntrinsicId::DYN_WIDE_CALLTHISRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_CALLINIT_PREF_IMM8_V8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_SUPERCALLTHISRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_DEFINESENDABLECLASS_PREF_IMM16_ID16_ID16_IMM16_V8,
     {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_WIDE_SUPERCALLARROWRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_THROW_IFSUPERNOTCORRECTCALL_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDSENDABLECLASS_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_LDOBJBYINDEX_PREF_IMM32, {{0, B32}, {1, B0}}},
    {IntrinsicId::DYN_THROW_IFSUPERNOTCORRECTCALL_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDSENDABLEEXTERNALMODULEVAR_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_STOBJBYINDEX_PREF_V8_IMM32, {{0, B32}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDELDSENDABLEEXTERNALMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_STOWNBYINDEX_PREF_V8_IMM32, {{0, B32}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_NEWSENDABLEENV_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_COPYRESTARGS_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDENEWSENDABLEENV_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_LDLEXVAR_PREF_IMM16_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_STSENDABLEVAR_PREF_IMM4_IMM4, {{0, B4}, {1, B4}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_WIDE_STLEXVAR_PREF_IMM16_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_STSENDABLEVAR_PREF_IMM8_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_WIDE_GETMODULENAMESPACE_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDESTSENDABLEVAR_PREF_IMM16_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEPRECATED_CALLRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_STMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDSENDABLEVAR_PREF_IMM4_IMM4, {{0, B4}, {1, B4}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_WIDE_LDLOCALMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDSENDABLEVAR_PREF_IMM8_IMM8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEPRECATED_CALLTHISRANGE_PREF_IMM16_V8, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_LDEXTERNALMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDELDSENDABLEVAR_PREF_IMM16_IMM16, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEPRECATED_DEFINECLASSWITHBUFFER_PREF_ID16_IMM16_IMM16_V8_V8,
     {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_WIDE_LDPATCHVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_ISTRUE_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_WIDE_STPATCHVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_ISFALSE_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDLAZYMODULEVAR_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDELDLAZYMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDLAZYSENDABLEMODULEVAR_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDELDLAZYSENDABLEMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_LDSENDABLELOCALMODULEVAR_PREF_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_CALLRUNTIME_WIDELDSENDABLELOCALMODULEVAR_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_DEPRECATED_LDOBJBYINDEX_PREF_V8_IMM32, {{0, B32}, {1, B0}}},
    {IntrinsicId::DYN_DEPRECATED_STLEXVAR_PREF_IMM4_IMM4_V8, {{0, B4}, {1, B4}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEPRECATED_STLEXVAR_PREF_IMM8_IMM8_V8, {{0, B8}, {1, B8}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEPRECATED_STLEXVAR_PREF_IMM16_IMM16_V8, {{0, B16}, {1, B16}, {INDEX_2, B0}}},
    {IntrinsicId::DYN_DEPRECATED_LDMODULEVAR_PREF_ID32_IMM8, {{0, B8}, {1, B0}}},
    {IntrinsicId::DYN_DEPRECATED_CREATEOBJECTHAVINGMETHOD_PREF_IMM16, {{0, B16}, {1, B0}}},
    {IntrinsicId::DYN_DEPRECATED_ASYNCGENERATORREJECT_PREF_V8_V8, {{0, B0}}},
};
TEST_F(InsnInfoTest, InsnInfoTestTest)
{
    for (const auto &[intrinsicId, second] : gArgsToResultMap_) {
        for (const auto &[idx, result] : second) {
            EXPECT_EQ(libabckit::GetIntrinsicBitImmSize(intrinsicId, idx), result);
        }
    }
}
}  // namespace libabckit::test::codegen
